package com.hsmpay.mobile.dao.other.impl;

import com.hsmpay.common.dao.Impl.BaseDaoSupport;
import com.hsmpay.mobile.dao.other.HelpDao;
import com.hsmpay.mobile.pojo.other.Help;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

/**
 * 用户帮助
 *
 * @author Steven
 */
@Repository("helpDao")
public class HelpDaoImpl extends BaseDaoSupport<Help, Long> implements HelpDao<Help, Long> {
    /**
     * 获取某个终端角色下的最大version
     *
     * @param terminalTypeId
     * @param roleId
     * @return
     * @throws SQLException
     */
    public int getMaxVersion(Long terminalTypeId, Long roleId) throws SQLException {
        Help help = new Help();
        help.setTerminalTypeId(terminalTypeId);
        help.setRoleId(roleId);
        return (Integer) getSqlMapClientTemplate().queryForObject("helpSqlMap.getMaxVersion", help);
    }
}
